/*
 *
 *  * Copyright (c) iwindplus Technologies Co., Ltd.2024-2030, All rights reserved.
 *
 *
 */

package com.iwindplus.base.async.cmd.service;

import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.github.yulichang.repository.JoinRepository;
import com.iwindplus.base.async.cmd.domain.dto.AsyncCmdEditDTO;
import com.iwindplus.base.async.cmd.domain.dto.AsyncCmdSaveDTO;
import com.iwindplus.base.async.cmd.model.AsyncCmdDO;
import java.util.List;

/**
 * 异步命令业务层接口类.
 *
 * @author zengdegui
 * @since 2025/9/14
 */
public interface AsyncCmdService extends JoinRepository<AsyncCmdDO> {

    /**
     * 添加.
     *
     * @param entity 对象
     * @return boolean
     */
    boolean save(AsyncCmdSaveDTO entity);

    /**
     * 批量删除.
     *
     * @param ids 主键集合
     * @return boolean
     */
    boolean removeByIds(List<Long> ids);

    /**
     * 编辑.
     *
     * @param entity 对象
     * @return boolean
     */
    boolean edit(AsyncCmdEditDTO entity);

    /**
     * 批量更新.
     *
     * @param entities  对象集合
     * @param batchSize 批次大小
     * @return boolean
     */
    boolean editBatch(List<AsyncCmdEditDTO> entities, int batchSize);

    /**
     * 批量更新.
     *
     * @param entities 对象集合
     * @return boolean
     */
    default boolean editBatch(List<AsyncCmdEditDTO> entities) {
        return this.editBatch(entities, Constants.DEFAULT_BATCH_SIZE);
    }
}
